home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44a.zip / CENT11.QM < prev    next >
Text File  |  1991-10-21  |  9KB  |  207 lines

  1. *                            CENT11.QM,  v1.1b
  2. *           Macros to Center Lines, Paragraphs and Documents
  3. *                       Written by Tom Hogshead
  4. *       With Macro Contributions by John Goodman and Kyle Watkins
  5. *                                10/20/91
  6. *
  7. *   @(3) Position Cursor at Center of Line                                |new
  8. *
  9. *   @(1) Centers Line, Moves To Next Line
  10. *   @(2) Centers Paragraph, Moves To Next Paragraph
  11. *   @(6) Centers Entire Document (Written by John Goodman)
  12. *
  13. * ┌ @(5) Center Current Line or Lines Delineated by Any Block
  14. * │        (Written by John Goodman)
  15. * └ @(8) Center Line(s) Delineated by Any Block (or Current Line
  16. *        if No Blocks Marked) within User-Prompted Right Margin
  17. *           (Does not Reset QEdit Right Margin Setting)
  18. *           (Written by John Goodman)
  19. *
  20. * ┌ @(4) Centers Line After Typing (Kyle Watkins, SemWare)
  21. * │                 (same as greyenter, for use with NON-enhanced keyboards)
  22. * └ (greyenter)
  23. *        Centers Line After Typing (Kyle Watkins, SemWare)
  24. *                   (for use with enhanced keyboards only)
  25. *
  26. *--eoi
  27.  
  28. * For other macros, see ALLMACRO.INF. For macros to remove centering
  29. * by deleteing leading space in front of lines, blocks and paragraghs
  30. * see DELSPxx.QM by John Goodman.
  31.  
  32. * These macros require "QEdit and QMAC v2.1, February, 1990" or later.
  33. *
  34. * To BEGIN, just type "START CENT" <Enter>. All pertinent files will be
  35. * loaded in the "Ring" for viewing, and CENT11.MAC is read.
  36. * Alternatively, type "START CENT 0" <Enter> and the disk copies of all
  37. * files in the "Ring" will be loaded ready for editing, saving time.
  38.  
  39. * 
  40. * -------------------------
  41. * @(1) Center Current Line
  42. * -------------------------
  43. * This macro centers the line in which the cursor is currently
  44. * positioned and moves to the next line.
  45. *
  46. @1  MacroBegin UnmarkBlock CenterLine CursorDown
  47. *
  48. * 6 bytes Sat  08-25-1990  12:13:33
  49. * 7 bytes Wed  05-15-1991  10:29:43 (JG/TH)
  50.  
  51. * 
  52. * ------------------------------
  53. * @(2) Center Current Paragraph
  54. * ------------------------------
  55. * This macro centers the lines in the paragraph in which the
  56. * cursor is currently positioned (or the previous paragraph
  57. * if the cursor is on a blank line) and moves to the next
  58. * paragraph.
  59.  
  60. @2  MacroBegin UnmarkBlock CursorDown PrevPara MarkLine NextPara
  61.     CursorUp CenterLine UnmarkBlock CursorDown MakeCtrofScreen
  62. *
  63. * 18 bytes Sat  08-25-1990  12:13:44
  64. * 14 bytes Wed  05-15-1991  10:36:51 (JG/TH)
  65.  
  66. * 
  67. * ---------------------------------------
  68. * @(3) Position Cursor at Center of Line
  69. * ---------------------------------------
  70. * This macro positions the cursor at center of right margin setting,
  71. * e.g. if right margin is set to 80, cursor is positioned in col 41.
  72.  
  73. @3      MacroBegin UnmarkBlock InsertLine BegLine DropAnchor DropAnchor
  74.         CenterLine GotoBlockBeg DelLine
  75. *
  76. * 12 bytes Tue  10-08-1991  07:15:42 (TH @3)
  77.  
  78. * 
  79. * ----------------------------------------------------------------------
  80. * @(4) Center Line After Typing, from Kyle Watkins, Semware
  81. * ----------------------------------------------------------------------
  82. * In case you do not have an enhanced keyboard, you may want to use
  83. * the following macro instead of greyenter at the end:
  84.  
  85. @4  macrobegin centerline endline return
  86. *
  87. * 7 bytes Sun  08-26-1990  03:08:09
  88.  
  89. * 
  90. * -------------------------------------------------------------
  91. * @(5) Center Line(s) Delineated by Any Block (or Current Line
  92. *      if No Blocks Marked), John Goodman, author
  93. * -------------------------------------------------------------
  94. * This macro centers all lines bound by block begin and end
  95. * positions.  Any type of block (character, line, or column) may
  96. * be used to delineate the line(s) and only one block marker need
  97. * be set.  If no block markers are set, the current line is
  98. * centered.  The cursor will be placed on the line following the
  99. * last one centered so that the macro can be invoked repeatedly
  100. * to center a series of lines.
  101.  
  102. @5 MacroBegin
  103.     CursorRight           * Needed for single-line blocks
  104.     GotoBlockEnd          * Try going to block end, retain pos.
  105.  JTrue BLK:               * Determine if a completed block
  106.     DropAnchor            * If not, DropAnchor will finish it
  107.                           * or mark current line if none started
  108.     GotoBlockEnd          * Go to block end to retain position
  109.  BLK:
  110.     GotoBlockBeg          * Start at the 1st line
  111.     MarkLine              * Mark first line
  112.     PrevPosition          * Return to where block ended
  113.     CenterLine            * Center the Blocked Lines
  114.     UnmarkBlock           * Unmark the block
  115.     CursorDown            * Goto Next Line to Do Again
  116.     BegLine
  117. *
  118. * 17 bytes Fri  04-19-1991  17:23:18
  119. * 18 bytes Wed  05-15-1991  11:03:25 (JG)
  120.  
  121. * 
  122. *-------------------------------------------------
  123. * @(6) Center Entire Document
  124. *      (Written by Tom Hogshead and John Goodman
  125. *-------------------------------------------------
  126. * This macro centers every line in the file currently being edited.
  127. *
  128. @6  MacroBegin UnmarkBlock EndFile MarkLine BegFile CenterLine UnmarkBlock
  129. *
  130. * 11 bytes Fri  04-19-1991  17:34:59
  131. * 10 bytes Wed  05-15-1991  11:30:04 (JG/TH)
  132.  
  133. * 
  134. * -------------------------------------------------------------
  135. * @(8) Center Line(s) Delineated by Any Block (or Current Line
  136. *      if No Blocks Marked) within User-Prompted Right Margin
  137. *      (Does not Reset QEdit Right Margin Setting)
  138. *      (Written by John Goodman)
  139. * -------------------------------------------------------------
  140. * This macro centers lines between column 1 and a right margin
  141. * entered by the user at the "Goto column" prompt.  Lines that are
  142. * longer than the column number entered by the user will be shifted
  143. * all the way to the left.  Any type of block (character, line, or
  144. * column) may be used to delineate the line(s) and only one block
  145. * marker need be set. If no block markers are set, the current line
  146. * is centered.  The cursor will be placed on the line following the
  147. * last one centered so that the macro can be invoked repeatedly to
  148. * center a series of lines.  This macro does not reset the QEdit
  149. * right margin setting normally used to center or wordwrap lines.
  150. *
  151. @8  MacroBegin
  152.     CursorRight   * Needed for single line block
  153.     GotoBlockEnd  * Try going to block end, retain pos.
  154.  JTrue BLK:       * Determine if a completed block
  155.     DropAnchor    * If not, DropAnchor will finish it
  156.                   * or mark current line if none started
  157.     GotoBlockEnd  * Go to block end to retain position
  158.     MarkLine      * Mark first line
  159.  BLK:             * Line block now set
  160.     BegLine       * Go to begin of last line
  161.     GotoBlockBeg  * Go straight up to 1st line of block
  162.     MarkColumn    * Start column block
  163.     PrevPosition  * Return to last line of block
  164.     BegLine       * Make sure we're in col 1
  165.     GotoColumn    * Prompt user for right margin
  166.       Pause Return
  167.     CenterLine    * Centerline will now del leading spaces
  168.     UnmarkBlock   * Unmark the block
  169.     BegLine       * Go to begin of last line
  170.     CursorDown    * Move to next line to do again!
  171. *
  172. * 24 bytes Tue  06-25-1991  18:55:41 (JG)
  173.  
  174. * 
  175. * ----------------------------------------------------------------------
  176. * (GreyEnter) Center Line After Typing, from Kyle Watkins, Semware
  177. * ----------------------------------------------------------------------
  178.  
  179. * This macro, written by Kyle Watkins of SemWare, requires an enhanced
  180. * keyboard
  181.  
  182. greyenter   macrobegin centerline endline return
  183. *
  184. * 7 bytes Sat  08-25-1990  17:32:31 (size added by TH)
  185.  
  186. * Now when you type your text, then press the Grey Enter Key (Far right
  187. * hand side of your keyboard), your text will be centered as the cursor
  188. * moves to the next line.
  189. *     This will keep your regular Enter key, to be used as normal --
  190. * Please note that if you DO NOT have an enhanced (101 key) keyboard, with
  191. * QEdit recognizing it as such -- then the Grey Enter and regular Enter,
  192. * are treated as the same key.
  193.  
  194. * Version History:
  195. *
  196. * 1.1  -Removed @3, replaced with @6 (J Goodman) which does the same
  197. *       thing but much faster and smoother.
  198. *      -Added @5 to Center Current Line or Lines Delineated by Any
  199. *       Block (J Goodman)
  200. *      -Modified @1/2/6 per John Goodman
  201. *      -Added @8 to center lines with user prompted right margin,
  202. *       Written by John Goodman.
  203. * 1.1a -Minor documentation changes
  204. * 1.1b -Added @3 to position cursor at center of line.                 10/8/91
  205.  
  206.  
  207.